home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Typography Samples / Dave’s Fab Samples ƒ / DavesFabSamples.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-20  |  6.1 KB  |  160 lines  |  [TEXT/KAHL]

  1. #ifndef __DAVESFABSAMPLES__
  2. #define __DAVESFABSAMPLES__
  3. /******************************************************************************\
  4. *
  5. * Apple Macintosh Developer Technical Support
  6. *
  7. * Main header file for the DavesFabSamples application
  8. *
  9. * Program: DavesFabSamples
  10. * File:    DavesFabSamples.h
  11. *
  12. * by:      Forrest Tanaka
  13. *
  14. * Copyright © 1988-1991 Apple Computer, Inc.
  15. * All rights reserved.
  16. *
  17. \******************************************************************************/
  18.     
  19.  
  20. /******************************************************************************\
  21. * Header Files
  22. \******************************************************************************/
  23.  
  24. #ifndef __STANDARDFILE__
  25. #include <StandardFile.h>
  26. #endif
  27.  
  28. #ifndef __WINDOWS__
  29. #include <Windows.h>
  30. #endif
  31.  
  32.  
  33. /******************************************************************************\
  34. * Constants
  35. \******************************************************************************/
  36.  
  37. /* Alert types */
  38. #define kGenericAlert 0 /* Display a generic alert */
  39. #define kNoteAlert    1 /* Display the note alert */
  40. #define kCautionAlert 2 /* Display the caution alert */
  41. #define kStopAlert    3 /* Display the stop alert */
  42.  
  43. /* Alert button options */
  44. #define rOKAlertID       6010 /* Resource ID of OK alert */
  45. #define rOKCancelAlertID 6011 /* Resource ID of OK/Cancel alert */
  46. #define rSaveAlertID     6012 /* Resource ID of Save/Cancel/Don’t Save alert */
  47.  
  48. /* Memory error message constants */
  49. #define rMemErrMessages    1000 /* Resource ID of memory error msg STR# */
  50. #define kMemErrAppOpenMsg  1    /* Not enough memory to open application */
  51. #define kMemErrOpenDocMsg  2    /* Not enough memory to open a document */
  52.  
  53. /* Resource error message constants */
  54. #define rResErrMessages     1001 /* Resource ID of resource err message STR# */
  55. #define kResErrAppDamageMsg 1    /* Application is damaged */
  56.  
  57. /* Miscellaneous error message constants */
  58. #define rMiscErrMessages   1002 /* Resource ID of misc. error message STR# */
  59. #define kMiscErrUnknownMsg 1    /* Unknown error */
  60. #define kMiscErrNoQTMsg    2    /* QuickTime not available */
  61. #define kMiscQuickTimeMsg  3    /* Some sort of QuickTime error */
  62.  
  63. /* File error message constants */
  64. #define rFileErrMessages   1003 /* Resource ID of file error message STR# */
  65. #define kFileErrDocOpenMsg 1    /* Document is already open elsewhere */
  66.  
  67.  
  68. /******************************************************************************\
  69. * Macros
  70. \******************************************************************************/
  71.  
  72. #ifdef applec
  73. #define topLeft(r) (*((gxPoint *) &(r).top))
  74. #define botRight(r) (*((gxPoint *) &(r).bottom))
  75. #endif
  76.  
  77. #define hiWord(a) ((short) (((unsigned long) a) >> 16L))
  78. #define loWord(a) ((short) ((unsigned long) a))
  79.  
  80.  
  81. /******************************************************************************\
  82. * Global Variables
  83. \******************************************************************************/
  84.  
  85. extern Boolean gQuitting;            /* True if user requested that app quit */
  86. extern Boolean gWereInFront;         /* True if this application is frontmost */
  87. extern Boolean gFixMenus;            /* True if menus need fixing */
  88. extern Boolean gHasAppleEvents;      /* True if Apple Events implemented */
  89. extern Boolean gHasCoolSF;           /* True if 7.0 Standard File available */
  90.  
  91.  
  92. /******************************************************************************\
  93. * DoQuit - Handle Quit request from the user
  94. *
  95. * When the user requests that this application should quit, DoQuit is called to
  96. * perform the Quit command.  All open document windows and desk accessory
  97. * windows (only applicable before system software version 7.0) are closed and
  98. * the gQuitting global variable is set to true.
  99. \******************************************************************************/
  100.  
  101. void DoQuit(void);
  102.  
  103.  
  104. /******************************************************************************\
  105. * DoUpdateEvt - Handle an update event for any window
  106. *
  107. * When an update event is received, DoUpdateEvt is called to handle the
  108. * redrawing of the window that caused the update event.  DoUpdateEvt determines
  109. * the kind of window that needs updating and calls the routine that handles that
  110. * kind of window to draw it.  The anEvent parameter contains the update event.
  111. \******************************************************************************/
  112.  
  113. void DoUpdateEvt(
  114.     EventRecord *anEvent);
  115.  
  116.  
  117. /******************************************************************************\
  118. * DoActivateEvt - Handle an activate event for any window
  119. *
  120. * DoActivateEvt is called when an active event is received for the window
  121. * specified by eventWind.  becomingActive is TRUE if the window is becoming
  122. * activated.  It’s FALSE if the window is becoming inactive.
  123. \******************************************************************************/
  124.  
  125. void DoActivateEvt(
  126.     WindowPtr eventWindow,
  127.     Boolean   becomingActive);
  128.  
  129.  
  130. /******************************************************************************\
  131. * ShowAlert - Show an alert
  132. *
  133. * This routine puts up a an alert with a specified message.  alertType specifies
  134. * which kind of icon to display in the upper-left corner of the alert.
  135. * kGenericAlert specifies that no icon should be displayed.  kNoteAlert
  136. * specifies that the note icon should be displayed.  kCautionAlert specifies
  137. * that the caution icon should be displayed.  kStopAlert specifies that the stop
  138. * icon should be displayed.
  139. *
  140. * buttonOption specifies what buttons should be offered.  rOKAlertID specifies
  141. * that only an OK button should be offered.  rOKCancelAlertID specifies that
  142. * both an OK and a Cancel button should be offered.
  143. *
  144. * messageClass specifies the STR# resource ID which contains the message to
  145. * display and messageIndex specifies the index (the first message is index 1)
  146. * into that STR# of the message to display.
  147. *
  148. * The alert window is placed into alert position on the screen containing most
  149. * of the window specified by parentWindow, or the main screen if parentWindow is
  150. * nil.
  151. \******************************************************************************/
  152.  
  153. short ShowAlert(
  154.     short alertType,
  155.     short buttonOption,
  156.     short messageClass,
  157.     short messageIndex);
  158.  
  159. #endif
  160.